<template>
  <div>
    <!-- 搜索栏区域 -->
    <el-card class="SearchCard" body-style="padding:0px">
      <el-row>
        <el-col :span="2">
          <div class="SearchTitle">条件搜索栏</div>
        </el-col>
        <el-col :span="4">
          <el-row>
            <el-col :span="10">
              <div class="SearchLable">搜索关键字</div>
            </el-col>

            <el-col :span="14">
              <div class="SearchLable">
                <el-input placeholder="请输入内容" v-model="queryInfo.srm" clearable @clear="clearEvent"></el-input>
              </div>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="2">
          <div class="SearchLable">
            <el-button size="medium" type="primary" @click="getSearchList()">搜索</el-button>
          </div>
        </el-col>
        <el-col :span="2">
          <div class="SearchLable">
            <el-button size="medium" type="primary" @click="getSearchWh(1)">已维护搜索</el-button>
          </div>
        </el-col>
        <el-col :span="2">
          <div class="SearchLable">
            <el-button size="medium" type="primary" @click="getSearchWh(0)">未维护搜索</el-button>
          </div>
        </el-col>
        <el-col :span="2">
          <div class="SearchLable">
            <el-button size="medium" type="primary" @click="getSearchList()">自定义维护</el-button>
          </div>
        </el-col>
      </el-row>
    </el-card>
    <el-card class="TableCard" :body-style="{ padding: '0px' }">
      <div>
        <el-table
          :data="tableData"
          border
          :header-cell-style="{ 'text-align':'center',background: '#3F9DFD', color: '#FFF' }"
          :cell-style="{'text-align':'center'}"
          size="medium"
          stripe
          height="704"
          style="width: 100%;font-size:12px"
        >
          <el-table-column prop="ypdm" label="药品编码" fixed width="100"></el-table-column>
          <el-table-column fixed prop="name" label="操作" width="100">
            <template slot-scope="scope">
              <el-button type="text" size="mini" @click="showEditDialog(scope.row.id)">编辑</el-button>
            </template>
          </el-table-column>
          <el-table-column fixed width="100" prop="ypmc" label="药品名称"></el-table-column>

          <el-table-column width="100" prop="ypjx" fixed label="	剂型"></el-table-column>
          <el-table-column width="100" prop="ypgg" label="规格"></el-table-column>
          <el-table-column width="100" prop="tymc" label="	通用名称"></el-table-column>
          <el-table-column width="100" prop="ddd" label="DDD值"></el-table-column>
          <el-table-column width="100" prop="ddddw" label="DDD单位"></el-table-column>
          <el-table-column width="100" prop="kjy" label="抗菌药">
            <template slot-scope="scope">{{(scope.row.kjy==1)?"是":(scope.row.kjy==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" label="抗菌药类型">
            <!-- (1抗细菌药，2抗真菌药，3抗结核药, 4其他抗菌药物) -->
            <template
              slot-scope="scope"
            >{{(scope.row.kjylx==1)?"细菌药":(scope.row.kjylx==2)?"抗真菌药":(scope.row.kjylx==3)?"抗结核药":(scope.row.kjylx==4)?"其他抗菌药物":""}}</template>
          </el-table-column>
          <el-table-column width="100" label="肿瘤药物">
            <template slot-scope="scope">{{(scope.row.zlyw==1)?"是":(scope.row.zlyw==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="kjyjb" label="抗菌药级别">
            <!-- 1非限制使用，2限制使用，3特殊使用 -->
            <template
              slot-scope="scope"
            >{{(scope.row.kjyjb==1)?"非限制使用":(scope.row.kjyjb==2)?"限制使用":(scope.row.kjyjb==3)?"特殊使用":""}}</template>
          </el-table-column>
          <el-table-column width="100" label="肿瘤药物分级">
            <!-- 1 特殊使用 2限制使用 3非限制使用 4无级别 -->
            <template
              slot-scope="scope"
            >{{(scope.row.zlywfj==1)?"特殊使用":(scope.row.zlywfj==2)?"限制使用":(scope.row.zlywfj==3)?"非限制使用":(scope.row.zlywfj==4)?"无级别":""}}</template>
          </el-table-column>
          <el-table-column width="100" label="剂型分类">
            <!-- （1 口服剂 2 注射剂 3其他） -->
            <template
              slot-scope="scope"
            >{{(scope.row.jxfl==1)?"口服剂":(scope.row.jxfl==2)?"注射剂":(scope.row.jxfl==3)?"其他":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="yplb" label="药品类别">
            <!-- (1化学药品，2 中成药 3中药材，4生物制品 ，5其他药品 ) -->
            <template
              slot-scope="scope"
            >{{(scope.row.yplb==1)?"化学药品":(scope.row.yplb==2)?"中成药":(scope.row.yplb==3)?"中药材":(scope.row.yplb==4)?"生物制品":(scope.row.yplb==5)?"其他药品":""}}</template>
          </el-table-column>
          <el-table-column width="100" label="兴奋剂">
            <!-- (1 是 0 否) -->
            <template slot-scope="scope">{{(scope.row.xfj==1)?"是":(scope.row.xfj==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="xfjcf" label="兴奋剂成分"></el-table-column>
          <el-table-column width="100" prop="gwyp" label="高危药品">
            <!-- 1 A级， 2 B级，3 C级 ，4非高危药品 -->
            <template
              slot-scope="scope"
            >{{(scope.row.gwyp==1)?"A级":(scope.row.gwyp==2)?"B级":(scope.row.gwyp==3)?"C级":(scope.row.gwyp==4)?"非高危药品":""}}</template>
          </el-table-column>
          <el-table-column width="100" label="精毒麻放">
            <!-- 1精一 2 精二 3毒 4麻 5放 6非特殊药品 -->
            <template
              slot-scope="scope"
            >{{(scope.row.jdfm==1)?"精一":(scope.row.jdfm==2)?"精二":(scope.row.jdfm==3)?"毒":(scope.row.jdfm==4)?"麻":(scope.row.jdfm==5)?"放":(scope.row.jdfm==6)?"非特殊药品":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="OTCbj" label="OTC标记">
            <!-- （1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <template
              slot-scope="scope"
            >{{(scope.row.OTCbj==1)?"OTC甲类":(scope.row.OTCbj==2)?"OTC乙类":(scope.row.OTCbj==3)?"非OTC":(scope.row.OTCbj==4)?"双跨":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="kjs" label="抗精神">
            <!-- (1 是 0 否) -->
            <template slot-scope="scope">{{(scope.row.kjs==1)?"是":(scope.row.kjs==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="kyy" label="抗抑郁">
            <!-- (1 是 0 否) -->
            <template slot-scope="scope">{{(scope.row.kyy==1)?"是":(scope.row.kyy==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="gjjbyw" label="国家基本药物">
            <!-- (1 是 0 否) -->
            <template slot-scope="scope">{{(scope.row.gjjbyw==1)?"是":(scope.row.gjjbyw==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="zbjbyw" label="增补基本药物">
            <!-- (1 是 0 否) -->
            <template slot-scope="scope">{{(scope.row.zbjbyw==1)?"是":(scope.row.zbjbyw==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="sb" label="社保">
            <!-- (1 甲类，2乙类，3非社保) -->
            <template
              slot-scope="scope"
            >{{(scope.row.sb==1)?"甲类":(scope.row.sb==2)?"乙类":(scope.row.sb==3)?"非社保":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="sbyyts" label="	社保用药提示"></el-table-column>
          <el-table-column width="100" prop="sbbxbl" label="	社保报销比例"></el-table-column>
          <el-table-column width="100" prop="xyzp" label="血液制品">
            <!-- (1 是 0 否) -->
            <template slot-scope="scope">{{(scope.row.xyzp==1)?"是":(scope.row.xyzp==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="tpzjs" label="糖皮质激素">
            <template slot-scope="scope">{{(scope.row.tpzjs==1)?"是":(scope.row.tpzjs==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="hkszj" label="缓控释制剂">
            <template slot-scope="scope">{{(scope.row.hkszj==1)?"是":(scope.row.hkszj==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="xps" label="需皮试">
            <template slot-scope="scope">{{(scope.row.xps==1)?"是":(scope.row.xps==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="gmy" label="感冒药">
            <template slot-scope="scope">{{(scope.row.gmy==1)?"是":(scope.row.gmy==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="zydpyp" label="中药毒性药品">
            <template slot-scope="scope">{{(scope.row.zydpyp==1)?"是":(scope.row.zydpyp==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="zygzyp" label="中药贵重药品">
            <template slot-scope="scope">{{(scope.row.zygzyp==1)?"是":(scope.row.zygzyp==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="fzyy" label="辅助用药">
            <template slot-scope="scope">{{(scope.row.fzyy==1)?"是":(scope.row.fzyy==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="rm" label="溶媒">
            <template slot-scope="scope">{{(scope.row.rm==1)?"是":(scope.row.rm==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="bdbksy" label="不得掰开使用">
            <template slot-scope="scope">{{(scope.row.bdbksy==1)?"是":(scope.row.bdbksy==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="zyzsj" label="中药注射剂">
            <template slot-scope="scope">{{(scope.row.zyzsj==1)?"是":(scope.row.zyzsj==0)?"否":""}}</template>
          </el-table-column>
          <el-table-column width="100" prop="zdysxmc" label="自定义属性"></el-table-column>
          <el-table-column width="100" prop="yllb" label="药理类别"></el-table-column>
          <el-table-column width="100" prop="matchUser" label="操作人"></el-table-column>
          <el-table-column width="100" prop="matchTime" label="	操作时间"></el-table-column>
          <el-table-column width="100" prop="tymcbm" label="通用名编码"></el-table-column>
          <el-table-column width="100" prop="yf" label="药房"></el-table-column>
        </el-table>
      </div>
      <div class="block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryInfo.pagenum"
          :page-sizes="[20, 50, 100]"
          :page-size="queryInfo.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="this.total"
          background
        ></el-pagination>
      </div>
    </el-card>
    <el-dialog title="药品基本信息" :visible.sync="dialogVisible" width="45%" :before-close="handleClose">
      <div class="InfoForm">
        <!-- div1  -->
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="通用名称">
            <el-input v-model="EditDictionData.tymc" size="small"></el-input>
          </el-form-item>
          <el-form-item class="curreLabel" label="通用名称检索码">
            <el-input v-model="EditDictionData.tymcsrc" size="small"></el-input>
          </el-form-item>
          <el-form-item label="药理类别">
            <el-input v-model="EditDictionData.claname" size="small">
              <el-button @click="showClass()" slot="append">选择</el-button>
              <el-button slot="append">清除</el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="自定义药品">
            <el-input v-model="EditDictionData.zdysxmc" size="small">
              <el-button slot="append" @click="showzdy()">选择</el-button>
              <el-button slot="append">清除</el-button>
            </el-input>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="药品类别" prop="resource">
            <el-radio-group v-model="EditDictionData.yplb">
              <el-radio :label="2">中成药</el-radio>
              <el-radio :label="3">中药饮片</el-radio>
              <el-radio :label="1">化学药品</el-radio>
              <el-radio :label="4">生物制品</el-radio>
              <el-radio :label="5">其他药品</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>

        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="抗菌药物" prop="resource">
            <el-radio-group v-model="EditDictionData.kjy">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="抗菌药物类别" prop="resource">
            <!-- 抗菌药物类型(1抗细菌药，2抗真菌药，3抗结核药, 4其他抗菌药物) -->
            <el-radio-group v-model="EditDictionData.kjylx">
              <el-radio :label="1">抗细菌药</el-radio>
              <el-radio :label="2">抗真菌药</el-radio>
              <el-radio :label="3">抗结核药/抗麻风药</el-radio>
              <el-radio :label="4">其他抗菌药物</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="抗菌药物级别" prop="resource">
            <!-- 抗菌药物级别(1非限制使用，2限制使用，3特殊使用) -->
            <el-radio-group v-model="EditDictionData.kjyjb">
              <el-radio :label="3">特殊使用</el-radio>
              <el-radio :label="2">限制使用</el-radio>
              <el-radio :label="1">非限制使用</el-radio>
              <el-radio :label="0">无级别</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="国家基本药物" prop="resource">
            <!-- 抗菌药物级别(1非限制使用，2限制使用，3特殊使用) -->
            <el-radio-group v-model="EditDictionData.gjjbyw">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="增补基本药物" prop="resource">
            <el-radio-group v-model="EditDictionData.zbjbyw">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="兴奋剂" prop="resource">
            <!-- 抗菌药物级别(1非限制使用，2限制使用，3特殊使用) -->
            <el-radio-group v-model="EditDictionData.xfj">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="兴奋剂成分" prop="resource">
            <el-input v-model="EditDictionData.xfjcf" size="small"></el-input>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="需皮试" prop="resource">
            <el-radio-group v-model="EditDictionData.xps">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="高危药品" prop="resource">
            <el-radio-group v-model="EditDictionData.gwyp">
              <el-radio :label="1">A级</el-radio>
              <el-radio :label="2">B级</el-radio>
              <el-radio :label="3">C级</el-radio>
              <el-radio :label="4">非高危药品</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="社保" prop="resource">
            <!-- 抗菌药物级别(1非限制使用，2限制使用，3特殊使用) -->
            <el-radio-group v-model="EditDictionData.sb">
              <el-radio :label="1">甲类</el-radio>
              <el-radio :label="2">乙类</el-radio>
              <el-radio :label="3">非社保</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="社保报销比例" prop="resource">
            <el-input v-model="EditDictionData.sbbxbl" size="small"></el-input>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="OTC标记" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.OTCbj">
              <el-radio :label="1">OTC甲类</el-radio>
              <el-radio :label="2">OTC已类</el-radio>
              <el-radio :label="3">非OTC</el-radio>
              <el-radio :label="4">双跨</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="社保用药提示" prop="resource">
            <el-input v-model="EditDictionData.sbyyts" size="small"></el-input>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="精/毒/麻/放" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.jdfm">
              <el-radio :label="1">精一</el-radio>
              <el-radio :label="2">精二</el-radio>
              <el-radio :label="3">麻</el-radio>
              <el-radio :label="4">毒</el-radio>
              <el-radio :label="5">放</el-radio>
              <el-radio :label="6">非特殊药品</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="抗抑郁" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.kyy">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="抗精神" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.kjs">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="血液制品" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.xyzp">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="中药贵重药物 " prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.zygzyp">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="中药毒性药物" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.zydpyp">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="剂型分类 " prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.jxfl">
              <el-radio :label="1">口服剂</el-radio>
              <el-radio :label="2">注射剂</el-radio>
              <el-radio :label="3">其他</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="不得掰开使用" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.bdbksy">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="缓控释制剂 " prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.hkszj">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="糖皮质激素" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.tpzjs">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="溶媒" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.rm">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="肿瘤药物" prop="resource">
            <el-radio-group v-model="EditDictionData.zlyw">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="肿瘤药物分级" prop="resource">
            <el-radio-group v-model="EditDictionData.zlywfj">
              <el-radio :label="1">特殊使用</el-radio>
              <el-radio :label="2">限制使用</el-radio>
              <el-radio :label="3">非限制使用</el-radio>
              <el-radio :label="4">无级别</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="中药注射剂" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.zyzsj">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="感冒药" prop="resource">
            <!-- 1 OTC甲类 2 OTC乙类 3 非OTC 4 双跨） -->
            <el-radio-group v-model="EditDictionData.gmy">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="DDD值" prop="resource">
            <el-input v-model="EditDictionData.ddd" size="small"></el-input>
          </el-form-item>
          <el-form-item label="DDD值单位" prop="resource">
            <el-input v-model="EditDictionData.ddddw" size="small"></el-input>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="儿科换算系数 " prop="resource">
            <el-input v-model="EditDictionData.ekhsxs" size="small"></el-input>
          </el-form-item>
          <el-form-item class="specialLabel" label="计价单位与ddd值单位换算关系" prop="resource">
            <el-input v-model="EditDictionData.hsgx" size="small">
              <template slot="prepend">1g=</template>
              <template slot="append">g</template>
            </el-input>
          </el-form-item>
        </el-form>
        <el-form :inline="true" :model="EditDictionData" class="demo-form-inline">
          <el-form-item label="药品DDD" prop="resource">
            <el-input v-model="EditDictionData.ypddd" size="small"></el-input>
          </el-form-item>
          <el-form-item class="specialLabel" label="计价单位与给药单位换算关系" prop="resource">
            <el-input v-model="EditDictionData.wu" size="small">
              <template slot="prepend">1g=</template>
              <template slot="append">g</template>
            </el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="UpdatadictDrugData()">保 存</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 药理类别选择 -->
    <el-dialog
      title="药理类别选择--单选"
      :visible.sync="ClassVisible"
      class="editDialog"
      width="30%"
      :before-close="handleClose"
    >
      <div style="width:100%;height:527px">
        <div class="addInput">
          <el-input v-model="ClassData.keyword" size="small" placeholder="药理类别搜索"></el-input>
          <el-button style="margin-right:8px" type="primary" size="small" @click="SearchDrug()">搜索</el-button>
        </div>
        <el-table
          :data="ClassData.tableData"
          stripe
          border
          height="400"
          style="width: 100%;font-size: 10px"
          :header-cell-style="{'text-align':'center'}"
          :row-style="{height:'40px'}"
          :cell-style="{'text-align':'center',padding:'0px'}"
        >
          <el-table-column label width="35">
            <template slot-scope="scope">
              <el-radio :label="scope.row" v-model="ClassData.radioId">&nbsp;</el-radio>
            </template>
          </el-table-column>

          <el-table-column prop="code" width="150" label="药理编码"></el-table-column>
          <el-table-column prop="name" label="药理类别"></el-table-column>
        </el-table>

        <span slot="footer" class="dialog-footer">
          <div class="SortFoot">
            <el-button
              style="margin-right:8px"
              type="primary"
              size="small"
              @click="SelectClass()"
            >确定</el-button>
            <el-button style="margin-right:8px" @click="RouteVisible = false" size="small">取消</el-button>
          </div>
        </span>
      </div>
    </el-dialog>
    <!-- 自定义药品 -->
    <el-dialog
      title="自定义药品选择--复选"
      :visible.sync="zdyVisible"
      class="editDialog"
      width="30%"
      :before-close="handleClose"
    >
      <div style="width:100%;height:527px">
        <div class="addInput">
          <el-input v-model="zdyData.keyword" size="small" placeholder="药理类别搜索"></el-input>
          <el-button style="margin-right:8px" type="primary" size="small" @click="SearchDrug()">搜索</el-button>
        </div>
        <el-table
          :data="zdyData.tableData"
          stripe
          border
          height="400"
          style="width: 100%;font-size: 10px"
          :header-cell-style="{'text-align':'center'}"
          :row-style="{height:'40px'}"
          :cell-style="{'text-align':'center',padding:'0px'}"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"></el-table-column>

          <el-table-column prop="name" label="药理类别"></el-table-column>
        </el-table>

        <span slot="footer" class="dialog-footer">
          <div class="SortFoot">
            <el-button style="margin-right:8px" type="primary" size="small" @click="Selectzdy()">确定</el-button>
            <el-button style="margin-right:8px" @click="RouteVisible = false" size="small">取消</el-button>
          </div>
        </span>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getdictDrugList,
  getdictDrugData,
  getzdyList,
  getyllbList,
  UpdatadictDrugData,
  getdictSfwhData
} from "@/api/rad";
export default {
  data() {
    return {
      queryInfo: {
        load: -1,
        srm: "",
        page: 1,
        pageSize: 20
      },
      total: 0,
      tableData: [],
      dialogVisible: false,
      EditDictionData: {
        id: "",
        ypdm: "",
        tymc: "",
        tymcsrc: "",
        yllb: "",
        claname: "",
        zdysx: "",
        zdysxmc: "",
        yplb: "",
        kjy: "",
        kjylx: "",
        kjyjb: "",
        gjjbyw: "",
        zbjbyw: "",
        xfj: "",
        xfjcf: "",
        xps: "",
        gwyp: "",
        sb: "",
        sbyyts: "",
        sbbxbl: "",
        OTCbj: "",
        jdfm: "",
        kyy: "",
        kjs: "",
        xyzp: "",
        zygzyp: "",
        zydpyp: "",
        jxfl: "",
        bdbksy: "",
        hkszj: "",
        tpzjs: "",
        fzyy: "",
        rm: "",
        zlyw: "",
        zlywfj: "",
        zyzsj: "",
        gmy: "",
        ddd: "",
        ddddw: "",
        ekhsxs: "",
        ypgg: "",
        jjdw: "",
        hsgx: "",
        wu: "",
        ypddd: "",
        kfgydw: "",
        sfsdwf: "",
        matchUser: "",
        matchTime: "",
        tymcbm: "",
        yf: ""
      },
      ClassVisible: false,
      ClassData: {
        keyword: "",
        tableData: [],
        radioId: []
      },
      zdyVisible: false,
      zdyData: {
        keyword: "",
        tableData: [],
        radioId: []
      }
    };
  },
  created: function() {
    this.getdictDrugList();
  },
  methods: {
    handleClose(done) {
      done();
    },
    handleSizeChange(newSize) {
      this.queryInfo.pageSize = newSize;
      if (this.queryInfo.load == -1) {
        this.getdictDrugList();
      } else {
        this.getdictSfwhData();
      }
    },

    handleCurrentChange(newPage) {
      this.queryInfo.page = newPage;
      if (this.queryInfo.load == -1) {
        this.getdictDrugList();
      } else {
        this.getdictSfwhData();
      }
    },
    handleSelectionChange(val) {
      this.zdyData.radioId = val;
      console.log(this.zdyData.radioId);
    },
    async getdictDrugList() {
      let res = await this.$rad.getdictDrugList({
        srm: this.queryInfo.srm,
        page: this.queryInfo.page,
        pageSize: this.queryInfo.pageSize
      });
      (this.tableData = res.rows), (this.total = res.total);
      console.log(res.rows);
    },
    getSearchWh(load) {
      this.queryInfo.load = load;
      this.getdictSfwhData();
    },
    async getdictSfwhData() {
      let res = await this.$rad.getdictSfwhData({
        sfsdwf: this.queryInfo.load,
        page: this.queryInfo.page,
        pageSize: this.queryInfo.pageSize
      });
      (this.tableData = res.rows), (this.total = res.total);
      console.log(res.rows);
    },
    getSearchList() {
      this.getdictDrugList();
    },
    clearEvent() {},
    showEditDialog(id) {
      this.dialogVisible = true;
      this.EditDictionData.id = id;
      this.getdictDrugData();
    },
    async getdictDrugData() {
      let res = await this.$rad.getdictDrugData({
        id: this.EditDictionData.id
      });
      console.log(res);
      this.EditDictionData.ypdm = res.ypdm;
      this.EditDictionData.tymc = res.tymc;
      this.EditDictionData.tymcsrc = res.tymcsrc;
      this.EditDictionData.yllb = res.yllb;
      this.EditDictionData.zdysx = res.zdysx;
      this.EditDictionData.zdysxmc = res.zdysxmc;
      this.EditDictionData.yplb = res.yplb;
      this.EditDictionData.kjy = res.kjy;
      this.EditDictionData.kjylx = res.kjylx;
      this.EditDictionData.kjyjb = res.kjyjb;
      this.EditDictionData.gjjbyw = res.gjjbyw;
      this.EditDictionData.zbjbyw = res.zbjbyw;
      this.EditDictionData.xfj = res.xfj;
      this.EditDictionData.xfjcf = res.xfjcf;
      this.EditDictionData.xps = res.xps;
      this.EditDictionData.gwyp = res.gwyp;
      this.EditDictionData.sb = res.sb;
      this.EditDictionData.sbyyts = res.sbyyts;
      this.EditDictionData.sbbxbl = res.sbbxbl;
      this.EditDictionData.OTCbj = res.OTCbj;
      this.EditDictionData.jdfm = res.jdfm;
      this.EditDictionData.kyy = res.kyy;
      this.EditDictionData.kjs = res.kjs;
      this.EditDictionData.xyzp = res.xyzp;
      this.EditDictionData.zygzyp = res.zygzyp;
      this.EditDictionData.zydpyp = res.zydpyp;
      this.EditDictionData.jxfl = res.jxfl;
      this.EditDictionData.bdbksy = res.bdbksy;
      this.EditDictionData.hkszj = res.hkszj;
      this.EditDictionData.tpzjs = res.tpzjs;
      this.EditDictionData.fzyy = res.fzyy;
      this.EditDictionData.rm = res.rm;
      this.EditDictionData.zlyw = res.zlyw;
      this.EditDictionData.zlywfj = res.zlyw;
      this.EditDictionData.zyzsj = res.zyzsj;
      this.EditDictionData.gmy = res.gmy;
      this.EditDictionData.ddd = res.ddd;
      this.EditDictionData.ddddw = res.ddddw;
      this.EditDictionData.ekhsxs = res.ekhsxs;
      this.EditDictionData.ypgg = res.ypgg;
      this.EditDictionData.jjdw = res.jjdw;
      this.EditDictionData.hsgx = res.hsgx;
      this.EditDictionData.wu = res.wu;
      this.EditDictionData.ypddd = res.ypddd;
      this.EditDictionData.kfgydw = res.kfgydw;
      this.EditDictionData.sfsdwf = res.sfsdwf;
      this.EditDictionData.matchUser = res.matchUser;
      this.EditDictionData.matchTime = res.matchTime;
      this.EditDictionData.tymcbm = res.tymcbm;
      this.EditDictionData.yf = res.yf;
    },
    showClass() {
      this.ClassVisible = true;
      this.getyllbList();
    },
    async getyllbList() {
      let res = await this.$rad.getyllbList({
        keyword: this.ClassData.keyword
      });
      this.ClassData.tableData = res;
      console.log(res);
    },
    SelectClass() {
      //   if (this.ClassData.radioId.length == 0) {
      //     this.$message({
      //       type: "warning",
      //       message: "请选择药理类别"
      //     });
      //   } else {}
      //   this.ClassData.radioId.
      // console.log(this.ClassData.radioId);
      this.EditDictionData.yllb = this.ClassData.radioId.code;
      this.EditDictionData.claname = this.ClassData.radioId.name;
      this.ClassVisible = false;
    },
    showzdy() {
      this.zdyVisible = true;
      this.getzdyList();
    },
    async getzdyList() {
      let res = await this.$rad.getzdyList({
        keyword: this.zdyData.keyword
      });
      this.zdyData.tableData = res;
    },
    Selectzdy() {
      var name = "";
      var code = "";
      for (var i = 0; i < this.zdyData.radioId.length; i++) {
        name += this.zdyData.radioId[i].name + ",";
        // console.log(this.zdyData.radioId[i].name);
        code += this.zdyData.radioId[i].code + ",";
      }
      this.EditDictionData.zdysxmc = name;
      this.EditDictionData.zdysx = code;
      //   console.log(name);
      //   console.log(code);
      this.zdyVisible = false;
    },
    async UpdatadictDrugData() {
      let res = await this.$rad.UpdatadictDrugData({
        id: this.EditDictionData.id,
        ypdm: this.EditDictionData.ypdm,
        tymc: this.EditDictionData.tymc,
        tymcsrc: this.EditDictionData.tymcsrc,
        yllb: this.EditDictionData.yllb,
        zdysx: this.EditDictionData.zdysx,
        zdysxmc: this.EditDictionData.zdysxmc,
        yplb: this.EditDictionData.yplb,
        kjy: this.EditDictionData.kjy,
        kjylx: this.EditDictionData.kjylx,
        kjyjb: this.EditDictionData.kjyjb,
        gjjbyw: this.EditDictionData.gjjbyw,
        zbjbyw: this.EditDictionData.zbjbyw,
        xfj: this.EditDictionData.xfj,
        xfjcf: this.EditDictionData.xfjcf,
        xps: this.EditDictionData.xps,
        gwyp: this.EditDictionData.gwyp,
        sb: this.EditDictionData.sb,
        sbyyts: this.EditDictionData.sbyyts,
        sbbxbl: this.EditDictionData.sbbxbl,
        OTCbj: this.EditDictionData.OTCbj,
        jdfm: this.EditDictionData.jdfm,
        kyy: this.EditDictionData.kyy,
        kjs: this.EditDictionData.kjs,
        xyzp: this.EditDictionData.xyzp,
        zygzyp: this.EditDictionData.zygzyp,
        zydpyp: this.EditDictionData.zydpyp,
        jxfl: this.EditDictionData.jxfl,
        bdbksy: this.EditDictionData.bdbksy,
        hkszj: this.EditDictionData.hkszj,
        tpzjs: this.EditDictionData.tpzjs,
        fzyy: this.EditDictionData.fzyy,
        rm: this.EditDictionData.rm,
        zlyw: this.EditDictionData.zlyw,
        zlywfj: this.EditDictionData.zlywfj,
        zyzsj: this.EditDictionData.zyzsj,
        gmy: this.EditDictionData.gmy,
        ddd: this.EditDictionData.ddd,
        ddddw: this.EditDictionData.ddddw,
        ekhsxs: this.EditDictionData.ekhsxs,
        ypgg: this.EditDictionData.ypgg,
        jjdw: this.EditDictionData.jjdw,
        hsgx: this.EditDictionData.hsgx,
        wu: this.EditDictionData.wu,
        ypddd: this.EditDictionData.ypddd,
        kfgydw: this.EditDictionData.kfgydw,
        sfsdwf: this.EditDictionData.sfsdwf,
        matchUser: this.EditDictionData.matchUser,
        matchTime: this.EditDictionData.matchTime,
        tymcbm: this.EditDictionData.tymcbm,
        yf: this.EditDictionData.yf
      });
      console.log(res);
      if (res.code == 1) {
        this.dialogVisible = false;
        this.getdictDrugList();
        return this.$message({
          type: "success",
          message: res.msg
        });
      } else {
        return this.$message({
          type: "error",
          message: res.msg
        });
      }
    }
  }
};
</script>
<style scoped>
.SearchCard {
  height: 50px;
  font-size: 12px;
}
.SearchTitle {
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid #c2c2c2;
}
.SearchLable {
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.TableCard {
  margin-left: 3px;
  margin-top: 2px;
}
.block {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 12px;
}
.InfoForm >>> .el-form-item {
  margin-right: 20px;
}
.InfoForm >>> .el-form-item__label {
  width: 100px;
}
.specialLabel >>> .el-form-item__label {
  width: 230px;
  text-align: left;
}
.curreLabel >>> .el-form-item__label {
  width: 120px;
  text-align: left;
}
.editDialog >>> .el-dialog__header {
  margin-bottom: 0px;
}
.editDialog >>> .el-dialog__body {
  padding-left: 0px;
  padding-right: 0px;
}
.addInput {
  height: 45px;
  display: flex;
  align-items: center;
}
.addInput >>> .el-input {
  width: 40%;
  margin-left: 8px;
}
.addInput >>> .el-button {
  margin-left: 8px;
}
.SortFoot {
  height: 50px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
</style>